import java.util.Scanner;
public class TextDemo {

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int eor = 0;
        int[] array = new int[num];
        for(int i = 0;i<num;i++){
            array[i] = scanner.nextInt();
            eor = eor^array[i];
        }
        //找出最右处为1的数
        int eor1 = eor & (~eor+1);

        int eor2 = 0;
        for(int i = 0;i<num;i++){
            if((eor1&array[i])!=0){
                eor2 = eor2^array[i];
            }
        }
        eor = eor^eor2;
        System.out.println(Math.min(eor,eor2)+" "+Math.max(eor,eor2));
    }

    public static void main2(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int eor = 0;
      for(int i = 0;i<num;i++){
         eor = eor^ scanner.nextInt();
      }

        System.out.println(eor);
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int[] array = new int[num];
        for(int i = 0;i<num;i++){
            array[i] = scanner.nextInt();
        }
        //arr长度为1时，arr[0]是局部最小。
        if(num==1){
            System.out.println(0);
            return;
            //如果arr[0] < arr[1]，那么arr[0]是局部最小；
        }else if(array[0]<array[1]){
            System.out.println(0);
            return;
            //如果arr[N-1]<arr[N-2],那么arr[N-1]是局部最小
        }else if(array[num-1]<array[num-2]){
            System.out.println(num-1);
            return;
        }else{
            int left = 0;
            int right = num-1;
            int min = -1;
            while(left<=right){
                min = (left+right)>>1;
                if(array[min]<array[min-1]&&array[min]<array[min+1]){
                    break;
                }else if(array[min]<array[min+1]){
                    right = min;
                }else if(array[min]>array[min+1]){
                    left = min;
                }

            }
            if(left>right){
                System.out.println(-1);
            }else{
                System.out.println(min);
            }
        }
    }
}
